package org.linlinjava.litemall.db.service.oder_manage;

import org.linlinjava.litemall.db.dao.AgedmallLgGoodsSignForRecordMapper;
import org.linlinjava.litemall.db.domain.AgedmallLgGoodsSignForRecord;
import org.linlinjava.litemall.db.domain.AgedmallLgGoodsSignForRecordExample;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 订单物流相关操作
 * @author houzb
 * @Description
 * @create 2021-11-24 19:58
 */
@Service
public class AgedmallOrderLogisticService {
    @Resource
    private AgedmallLgGoodsSignForRecordMapper agedmallLgGoodsSignForRecordMapper;

    /**
     * 获取签收的商品记录信息
     * @param itemOrderCode 子订单号
     * @param orderGoodsId 商品订单记录的id
     * @return
     */
    public AgedmallLgGoodsSignForRecord getGoodsSignRecord(String itemOrderCode, long orderGoodsId) {
        AgedmallLgGoodsSignForRecordExample agedmallLgGoodsSignForRecordExample = new AgedmallLgGoodsSignForRecordExample();
        agedmallLgGoodsSignForRecordExample.orderBy("id desc").createCriteria().andOrderCodeEqualTo(itemOrderCode)
                .andGoodsIdEqualTo(orderGoodsId);
        AgedmallLgGoodsSignForRecord record = agedmallLgGoodsSignForRecordMapper.selectOneByExample(agedmallLgGoodsSignForRecordExample);
        return record;
    }
}
